<template>
  <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
    <el-table-column label="姓名" align="center" prop="name" width="150px" />
    <el-table-column label="性别" align="center" prop="sex" width="150px" >
      <template #default="scope">
        <dict-tag :type="DICT_TYPE.SYSTEM_USER_SEX" :value="Number(scope.row.sex)" />
      </template>
    </el-table-column>
    <el-table-column label="手机号" align="center" prop="phone" width="150px" />
    <el-table-column label="身份证号码" align="center" prop="cardNum" width="150px" />
    <el-table-column label="关系" align="center" prop="relation" width="150px"/>
    <el-table-column label="行动是否方便" align="center" prop="defaultStatus" width="150px">
      <template #default="scope">
        <dict-tag :type="DICT_TYPE.PEIZHEN_TRUE_FALSE" :value="Number(scope.row.isWalk)" />
      </template>
    </el-table-column>
  </el-table>
</template>
<script lang="ts" setup>
import { DICT_TYPE } from '@/utils/dict'
import  {PaitentApi}  from '@/api/peizhen/paitent'

const { userId }: { userId: number } = defineProps({
  userId: {
    type: Number,
    required: true
  }
})

const loading = ref(true) // 列表的加载中
const total = ref(0) // 列表的总页数
const list = ref([]) // 列表的数据

/** 查询列表 */
const getList = async () => {
  loading.value = true
  try {
    let result= await PaitentApi.getPaitentPage({memberId: userId })
    list.value=result.list
  } finally {
    loading.value = false
  }
}

/** 初始化 **/
onMounted(() => {
  getList()
})
</script>

<style scoped lang="scss"></style>
